﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GoogleMapsAPI
{
    public partial class frmloaidiadiem : Form
    {
        frmMain frmmain;
        frmMarker frmmaker;
        frmcapnhat frmcapnhat;
        public frmloaidiadiem(frmMain f, frmMarker f2)
        {
            InitializeComponent();
            frmmain = f;
            frmmaker = f2;
        }
        public frmloaidiadiem(frmMain f, frmcapnhat f2)
        {
            InitializeComponent();
            frmmain = f;
            frmcapnhat = f2;
        }

        private void btnThemloai_Click(object sender, EventArgs e)
        {
            try
            {
                Data.InsertPlaceGroup(txtloai.Text);
                MessageBox.Show("Succeed.");
                frmmain.clearTree();
                frmmain.LoadTreeView();
                if (frmmaker != null)
                {
                    frmmaker.clearcombo();
                    frmmaker.loadcombo();
                }
                if (frmcapnhat != null)
                {
                    frmcapnhat.clearcombo();
                    frmcapnhat.loadcombo();
                }
            }
            catch (Exception ex)
            {

                MessageBox.Show("Fail.");
            }
           
        }

        private void frmloaidiadiem_Load(object sender, EventArgs e)
        {

        }
    }
}
